<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\common\validate;

/**
 * 会员验证器
 */
class Healthroom extends ValidateBase
{
    
    // 验证规则
    protected $rule = [
        'room_id'       => 'require|unique:my_healthroom',
        'name'          => 'require|chs|max:20',
        'address'       => 'require|max:255',
        'telphone'      => 'require|number|length:7,11',
        'disease_type'   => 'require',
    ];

    // 验证提示
    protected $message = [
        'room_id.require'             => '请输入小屋编号', 
        'room_id.unique'              => '小屋编号不可重复',
        'name.require'                => '请输入小屋名称',
        'name.chs'                    => '小屋名称请输入中文',
        'name.max'                    => '小屋名称请不要超过十个汉字',
        'address.require'             => '请输入小屋地址',
        'address.max'                 => '小屋地址请小于255位',
        'telphone.require'            => '请输入电话号码',
        'telphone.number'             => '电话号码请输入数字',
        'telphone.length'             => '电话号码请输入7位或11位',
        'disease_type.require'        => '请输入小屋主要疾病类型',


    ];

    // 应用场景
    protected $scene = [
        'add'  => ['room_id','name','address','telphone','disease_type'],
        'edit'  => ['room_id','name','address','telphone','disease_type'],        
        'import' => ['room_id','name',],
    ];
}
